﻿<!--
Copyright 2003-2009 Virtual Chemistry, Inc. (VCI)
http://www.virtualchemistry.com
Using .Net, Silverlight, SharePoint and more to solve your tough problems in web-based data management.

Author: Peter Coley
-->
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Import.aspx.cs" Inherits="SilverlightFileUploader.Web.TestPage" %>
<%@ Register TagPrefix="vci" Namespace="Vci.FileUploader" Assembly="Vci.FileUploader" %>
<%@ OutputCache Location="None" VaryByParam="None" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Pivotbrowser Import</title>
        <link href="ReportingStyle.css" rel="stylesheet" />

    <script type="text/javascript">
    
        window.onload = function() {

            // get the instance of UploaderControl that corresponds to the uploader1 server control
            var uploader1 = UploaderControl.getInstance("uploader1");
            
            // attach event handlers
            uploader1.attachEvent("onuploadstarted", uploader1_onuploadstarted);
            uploader1.attachEvent("onfileuploaded", uploader1_onfileuploaded);
        };
        
        // when an upload is started, set a context parameter that will be passed down to the ExampleFileProcessor
        function uploader1_onuploadstarted() {
            
            document.getElementById("divDebug").innerHTML = "";
            
            var uploader1 = UploaderControl.getInstance("uploader1");
            uploader1.setUserContext("n0thing");            
        }
        
        // do some custom js code when each file has completed uploading
        function uploader1_onfileuploaded(fileGuid, fileName, fileSize) {
        
            document.getElementById("divDebug").innerHTML += "Datei hochgeladen " + fileName + " " + fileSize + "<br/>";
            document.getElementById("divAnalyze").style.visibility = 'visible';
        }
        
    </script>

    <script type="text/javascript" language="JavaScript">

    function toggleMe(a) {
        var e = document.getElementById(a);
        if (!e) return true;
        if (e.style.display == "none") {
            e.style.display = "block"
        } else {
            e.style.display = "none"
        }
        return true;
    }

</script>


</head>
<body>
    <form id="form1" runat="server">

        <h1>&nbsp;&nbsp;&nbsp;Pivotbrowser - Import
             <asp:Button ID="Button5" CssClass="b" runat="server" Text="Zurück" Width="100px"  OnClick="Button5_Click"/> 
             <asp:Button ID="Button6" CssClass="c" runat="server" Text="Neue Anfrage" Width="100px" OnClick="Button6_Click"  /> 
        </h1>

        <h2> </h2>

        <br />

        <a class="dlink" onclick="return toggleMe('anleitung')" href="javascript:void(0)">HowTo</a>
        <br />
        <br />
        <a style="display:none;" class="dbox" id="anleitung">
        
             <a1 class="dlink" onclick="return toggleMe('anleitung5')" href="javascript:void(0)">Allgemeines</a1>
            <br />
          
            <ul style="display:none;" class="stichpunkt" id="anleitung5">
               <li></li>
            </ul>
            <br />

            <a1 class="dlink" onclick="return toggleMe('anleitung2')" href="javascript:void(0)">Upload</a1>
            <br />
            <ul style="display:none;" class="stichpunkt" id="anleitung2">
               <li>es können nur .zip-Dateien hichgeladen werden</li>
               <li>der Name der .zip-Datei spielt keine Rolle</li>
           </ul>
            <br />

            <a1 class="dlink" onclick="return toggleMe('anleitung3')" href="javascript:void(0)">Analyse</a1>
            <br />

            <ul style="display:none;" class="stichpunkt" id="anleitung3">
               <li>die Name der einzelen .csv-Dateien müssen den Vorgaben entsprechen - folgende Dateien sind erlaubt:
                   <ul>
                       <li>flex_fachgruppe_komplett.csv </li>
                       <li>flex_prfbem_komplett.csv </li>
                       <li>flex_prffach_komplett.csv </li>
                       <li>flex_prffachver_komplett.csv </li>
                       <li>flex_semester_komplett.csv </li>
                       <li>flex_studab_komplett.csv </li>
                       <li>flex_studabver_komplett.csv </li>
                       <li>flex_studfach_komplett.csv </li>
                       <li>flex_teilprf_komplett.csv</li>
                       <li>flex_prfstd_sample.csv</li>
                       <li>flex_studenfach_sem_sample.csv</li>
                       <li>flex_student_sample.csv</li>
                   </ul>
               </li>
               
           </ul>
           <br />

            <a1 class="dlink" onclick="return toggleMe('anleitung4')" href="javascript:void(0)">Import</a1>
            <br />         
           
            <ul style="display:none;" class="stichpunkt" id="anleitung4">
               <li>bei jedem Import wir VOR dem Einpflegen der neue Daten ein Backup der entsprechenden Tabellen erstellt</li>
               <li>die Backup-Dateien werden mit einem Zeitstempel versehen und können in der DropDown-Liste rechts ausgewählt werden</li>
               <li>um Backups zu importieren wird die gewünschte Datei ausgewählt und dann "Backup importieren" gedrückt</li>
           </ul>
        </a>

        <br />

        <h3>
           Dateien zum hochladen auswählen:
           <%=_sandbox%>
        </h3>
            
         <h4>
              <asp:Button 
                 ID="Button4" 
                 runat="server" 
                 Text="Backup importieren" 
                 Width="150px" 
                 OnClick="Button4_Click"
                 CssClass ="backup1"    
                 />
                <asp:DropDownList ID="DropDownList1" runat="server" CssClass ="backup2">
                </asp:DropDownList>
           
             <vci:UploaderControl ID="uploader1" runat="server" UploadedFileProcessorType="Vci.FileUploader.ExampleFileProcessor,Vci.FileUploader" />
             
         </h4>
        
            <div id="divDebug" style="margin-top:5px; margin-left: 15px; ">
                
            </div>

               &nbsp;&nbsp;&nbsp;&nbsp;

               <asp:Label
                ID="Label2"
                runat="server"
                Font-Bold="True"
                ForeColor="#000099"></asp:Label>
 
                <br />
                        
                <div id="divAnalyze" style="visibility:hidden; margin-left:15px;">
                <asp:Button
                ID="button2"
                Text="Analyze"
                runat="server"
                Width="73px"
                Enabled="true"   
                onclick="button2_Click"             
                />
                </div>
                &nbsp;&nbsp;&nbsp;&nbsp;
                
                <asp:Button
                ID="button3"
                Text="Import"
                runat="server"
                Width="73px"
                Visible="False"
                Enabled="true"
                onClick ="button3_Click"               
                />

                <br/>
                
        <h5>
                <asp:Label
                ID="Label3"
                runat="server"
                Font-Bold="True"
                ForeColor="#000099">
                </asp:Label>

                        
                <br/>
                
                <asp:Label
                ID="Label4"
                runat="server"
                Font-Bold="True"
                ForeColor="#000099">
                </asp:Label>

    
                <br/> 
                <br/>
                
                <br/>
        </h5>

    </form>
</body>
</html>
